const { PartStore, Part, Category } = require('../common/mysql.js')
const { Op } = require('sequelize')

module.exports = {
    async getList(store_id) {
        return await PartStore.findAll({
            include: [
                {
                    model: Part,
                    include: [
                        {
                            model: Category
                        }
                    ]
                }
            ],
            where: {
                store_id: {
                    [Op.eq]: store_id
                }
            }
        })
    }
}
